home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 1 / Gekikoh Dennoh Club Vol. 1 (Japan).7z / Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin / kowin / archive / sys / kowin14s.lzh / parts / operation.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-11  |  1.0 KB  |  49 lines

  1. #include <stdio.h>
  2.  
  3. #include "wlib.h"
  4. #include "winop.h"
  5.  
  6. #include    <HS_wlib.h>        /*    1992 by H.Ogasawara(COR.) */
  7. #include    "IconMan.nh"
  8.  
  9. WindowID
  10. IconifyOperation( wp, h, v, exec )
  11. WindowID    wp;
  12. int            h, v;
  13. int            (*exec)();
  14. {
  15.     int            x, y;
  16.     WindowID    iconwp;
  17.     IconMan        *cp;
  18.     int            attr= HS_WindowGetAttr(wp);    /* 1992 COR.*/
  19.  
  20.     WindowGetPosition( wp, &x, &y );
  21.     if( cp= WindowGetCommon( "IconMan", 0 ) ){
  22.         (*cp->exec)( wp );
  23.     }
  24.     WindowSetAttr( wp, WindowAttrInvisible );
  25.     iconwp= WindowSimpleOpen( x, y, h, v, NULL, exec );
  26.     WindowSetClientData( iconwp, attr, wp );
  27.     WindowRedraw( iconwp );
  28.     return    iconwp;
  29. }
  30.  
  31. void
  32. IconMouseOperation( wp, info )
  33. WindowID    wp;
  34. EventInfo    *info;
  35. {
  36.     if( info->LeftStat && info->MoveFlag ){
  37.         WindowMoveOperation( wp, info );
  38.     }else if( info->LeftOFF ){
  39.         int            x, y;
  40.         WindowID    parent;
  41.  
  42.         WindowGetPosition( wp, &x, &y );
  43.         parent= WindowGetClientPointer( wp );
  44.         WindowClose( wp );
  45.         WindowMove( parent, x, y );
  46.         WindowSetAttr( parent, WindowGetClientData( wp ) );
  47.     }
  48. }
  49.